Feature Group
bash internal / data manipulations / string manipulation and expansions / parameter expansion / brace expansion (7)
2
bash
This demonstrates the use of brace expansion in Bash to generate sequences of numbers and letters, while noting the limitation of not being able to use variables within brace expansions.
echo {1..10} # => 1 2 3 4 5 6 7 8 9 10 echo {a..z} # => a b c d e f g h i j k l m n o p q r s t u v w x y z # This will output the range from the start value to the end value. # Note that you can't use variables here: from=1 to=10 echo {$from..$to} # => {$from..$to} echo {{1..3},{7..9}} # => 1 2 3 7 8 9
bash internaldata manipulationsstring manipulation and expansionsparameter expansionbrace expansion